add_rules("mode.debug","mode.release")
option("demo")
	set_default(false)
    set_showmenu(true)
option("demo_path")
    set_showmenu(true)
includes("src/*.lua")
if has_config("demo") then
    target("main")    
        add_deps("pointscloud")
        set_targetdir("bin")
        set_kind("binary")

        add_files("$(demo_path)/*.cpp","$(demo_path)/*.c")
        add_includedirs("$(demo_path)","include","$(demo_path)/include","thirdpart/cstructures/include","thirdpart/eigen/Eigen",
            "thirdpart/glad/include","thirdpart/glfw/include","thirdpart/freetype/include","thirdpart/libcell/include","thirdpart/viewer/include")
       
        ---add_links("cstructures","cstruct_iterator","viewer","libcell","glfw3","GL","Xrandr","Xi","X11","Xxf86vm","pthread","Xinerama","Xcursor","freetype","png","z","harfbuzz")
        if is_plat("windows") then
            if is_plat("mingw") then
                add_links("viewer","libcell","cstructures","cstruct_iterator","glfw3","opengl32","freetype","gdi32","comdlg32","advapi32","Z")
            else
                add_cxflags("-MD")
                add_cxxflags("-MD")
                add_links("viewer","libcell","cstructures","cstruct_iterator","glfw3","opengl32",
                    "freetype","kernel32","user32","gdi32","comdlg32","advapi32","shell32")
            end 

        end
        if is_plat("linux") then
            add_links("viewer","libcell","cstructures","cstruct_iterator","glfw3", "GL", "Xrandr", "Xi", "X11", "Xxf86vm", "pthread", "Xinerama", "Xcursor", "dl", "freetype", "png", "z", "harfbuzz")
        
            add_ldflags("-no-pie ") 
        end
        add_linkdirs("lib","temp_libs")
        add_cxflags("-O2")
        add_cxxflags("-O2") 

end 
